package com.csesteel.crm.domain;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

/**
 * Created by Administrator on 2015/4/21 0021.
 */
@Entity
@Table(name="crm_tb_user")
public class User implements Serializable {

    private static final long serialVersionUID = 48L;
    @Id @Column(name="user_id")
    private Integer userId;
    private String username;
    private String password;
    private String telephone;
    private String email;
    private String delstatus;
    @Column(name="job_status")
    private String jobStatus;

    @OneToOne(cascade = CascadeType.ALL)
    @JoinTable(name = "crm_r_user_role", joinColumns = { @JoinColumn(name = "user_id", referencedColumnName = "user_id") }, inverseJoinColumns = { @JoinColumn(name = "role_id", referencedColumnName = "role_id") })
    private CrmRole crmRole;

    public CrmRole getCrmRole() {
        return crmRole;
    }

    public void setCrmRole(CrmRole crmRole) {
        this.crmRole = crmRole;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDelstatus() {
        return delstatus;
    }

    public void setDelstatus(String delstatus) {
        this.delstatus = delstatus;
    }

    public String getJobStatus() {
        return jobStatus;
    }

    public void setJobStatus(String jobStatus) {
        this.jobStatus = jobStatus;
    }


}
